#include <stdio.h>
#include "linkqueue.h"

int main(int argc, char const *argv[])
{
        int i = 0;
        int arr[10] = {0};
        LinkQueue* queue = NULL;

        queue = LinkQueue_Create();
        if(queue == NULL){
                printf("LinkQueue_Create failed\n");
                return -1;
        }

        for (i = 0; i < 5; i++){
                arr[i] = i + 1;
                LinkQueue_Append(queue, &arr[i]);
        }

        //打印队列
        printf("队列的长度:%d\n", LinkQueue_Length(queue));
        printf("队头:%d\n", *((int *)LinkQueue_Header(queue)));

        while ( LinkQueue_Length(queue) > 0  ){
                int tmp = *((int *)LinkQueue_Retrieve(queue));
                printf("%d ", tmp);
        }
        printf("\n");

        LinkQueue_Destory(queue);
        return 0;
}
